import logging
import redis


class Config:
    DEBUG=None
    # 把session信息存到redis中
    SECRET_KEY='lN7GrFRlvNqfvqjBL6s4yvx/pgbqttFdLuw6zlNX'


    SESSION_TYPE='redis'

    SESSION_REDIS=redis.StrictRedis(host='127.0.0.1',port=6379)

    SESSION_USE_SIGNER = True
    # 设置session有效时长
    PERMANENT_SESSION_LIFETIME =86400
    # SQLALCHEMY_DATABASE_URI='mysql://root:mysql@127.0.0.1:3306/new_year'
    SQLALCHEMY_DATABASE_URI='mysql://root:mysql@localhost/new_year'
    SQLALCHEMY_TRACK_MODIFICATIONS=False
    LOG_LEVEL = logging.DEBUG


class DevelopConfig(Config):
    DEBUG = True
class ProductConfig(Config):
    DEBUG=False
    LOG_LEVEL = logging.ERROR
config_dict={
    'dev':DevelopConfig,
    'pro':ProductConfig
}
